{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from Gan3 import Gan3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "loaded data\n"
     ]
    }
   ],
   "source": [
    "my_model = Gan3()"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Training epoch 1 ...\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/b8313/coding/music/melody-generator-gan/src/comp/RelationalMemory.py:169: UserWarning: Output 0 of SplitWithSizesBackward is a view and is being modified inplace. This view is an output of a function that returns multiple views. Inplace operators on such views are being deprecated and will be forbidden starting from version 1.8. Consider using `unsafe_` version of the function that produced this view or don't modify this view inplace. (Triggered internally at  /opt/conda/conda-bld/pytorch_1627336325426/work/torch/csrc/autograd/variable.cpp:547.)\n",
      "  q *= (self.key_size ** -0.5)\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Loss while training discriminator is: 1.2956473529338837\n",
      "Loss while training generator is: 1.3857995867729187\n",
      "Training epoch 2 ...\n",
      "Loss while training discriminator is: 1.210467889904976\n",
      "Loss while training generator is: 1.2587618827819824\n",
      "Training epoch 3 ...\n",
      "Loss while training discriminator is: 1.1017487049102783\n",
      "Loss while training generator is: 1.419534981250763\n",
      "Training epoch 4 ...\n",
      "Loss while training discriminator is: 0.9174587652087212\n",
      "Loss while training generator is: 1.6814140677452087\n"
     ]
    }
   ],
   "source": [
    "my_model.train_all_epochs()"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "outputs": [],
   "source": [
    "import torch"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Lyrics sequence is: torch.Size([100, 10, 32])\n",
      "Content Value Sequence is: torch.Size([100, 10, 4])\n",
      "Discrete value sequence is: torch.Size([100, 10, 3])\n",
      "This turn 0\n",
      "gen_out is: torch.Size([100, 10, 3])\n",
      "Lyrics sequence is: torch.Size([100, 10, 32])\n",
      "Content Value Sequence is: torch.Size([100, 10, 4])\n",
      "Discrete value sequence is: torch.Size([100, 10, 3])\n",
      "This turn 5000\n",
      "gen_out is: torch.Size([100, 10, 3])\n",
      "Lyrics sequence is: torch.Size([100, 10, 32])\n",
      "Content Value Sequence is: torch.Size([100, 10, 4])\n",
      "Discrete value sequence is: torch.Size([100, 10, 3])\n",
      "This turn 10000\n",
      "gen_out is: torch.Size([100, 10, 3])\n",
      "Lyrics sequence is: torch.Size([100, 10, 32])\n",
      "Content Value Sequence is: torch.Size([100, 10, 4])\n",
      "Discrete value sequence is: torch.Size([100, 10, 3])\n",
      "This turn 15000\n",
      "gen_out is: torch.Size([100, 10, 3])\n",
      "Lyrics sequence is: torch.Size([100, 10, 32])\n",
      "Content Value Sequence is: torch.Size([100, 10, 4])\n",
      "Discrete value sequence is: torch.Size([100, 10, 3])\n",
      "This turn 20000\n",
      "gen_out is: torch.Size([100, 10, 3])\n",
      "Lyrics sequence is: torch.Size([100, 10, 32])\n",
      "Content Value Sequence is: torch.Size([100, 10, 4])\n",
      "Discrete value sequence is: torch.Size([100, 10, 3])\n",
      "This turn 25000\n",
      "gen_out is: torch.Size([100, 10, 3])\n",
      "Lyrics sequence is: torch.Size([100, 10, 32])\n",
      "Content Value Sequence is: torch.Size([100, 10, 4])\n",
      "Discrete value sequence is: torch.Size([100, 10, 3])\n",
      "This turn 30000\n",
      "gen_out is: torch.Size([100, 10, 3])\n"
     ]
    }
   ],
   "source": [
    "my_model.get_gen_data(save=False)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "outputs": [
    {
     "data": {
      "text/plain": "torch.Size([100, 10, 64])"
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}